package com.example.hangzhou.welbeing.mytestdemoapp.designPatterns.BridgeModel;

import com.example.hangzhou.welbeing.mytestdemoapp.designPatterns.BridgeModel.Inter.MessageImplementor;
import com.example.hangzhou.welbeing.mytestdemoapp.designPatterns.BridgeModel.model.AbstractMessage;
import com.example.hangzhou.welbeing.mytestdemoapp.designPatterns.BridgeModel.model.CommonMessage;
import com.example.hangzhou.welbeing.mytestdemoapp.designPatterns.BridgeModel.model.MessageMobile;
import com.example.hangzhou.welbeing.mytestdemoapp.designPatterns.BridgeModel.model.MessageSMS;
import com.example.hangzhou.welbeing.mytestdemoapp.designPatterns.BridgeModel.model.SpecialUrgencyMessage;
import com.example.hangzhou.welbeing.mytestdemoapp.designPatterns.BridgeModel.model.UrgencyMessage;

/**
 * 杭州惟君医疗科技有限公司15
 * Created by 20433 on 2018/5/22
 *
 * @desc 东风山河绿，春已不折柳，繁花看不尽，处处惹人留
 * @desc 佛祖镇楼，bug辟容易
 */

public class Client {
    public static void main(String[] args) {
        //创建具体的实现对象
        MessageImplementor impl = new MessageSMS();
        //创建一个普通消息对象
        AbstractMessage m = new CommonMessage(impl);
        m.sendMessage("请喝一杯茶", "小李");


        //创建一个紧急消息对象
        m = new UrgencyMessage(impl);
        m.sendMessage("请喝一杯茶", "小李");

        //创建一个特急消息对象
        m = new SpecialUrgencyMessage(impl);
        m.sendMessage("请喝一杯茶", "小李");


        //把实现方式切换成手机短消息，然后再实现一遍
        impl = new MessageMobile();
        m = new CommonMessage(impl);
        m.sendMessage("请喝一杯茶", "小李");
        m = new UrgencyMessage(impl);
        m.sendMessage("请喝一杯茶", "小李");
        m = new SpecialUrgencyMessage(impl);
        m.sendMessage("请喝一杯茶", "小李");


    }
}
